#include<bits/stdc++.h>
using namespace std;
struct node{
	int n,po;
}num[8005];
bool cmp(node a,node b){return a.n<=b.n;}
int main(){
	freopen("sort.in","r",stdin);
	//freopen("sort.out","w",stdout);
	int n,q,mode;
	cin>>n>>q;
	for(int i=1;i<=n;++i){
		cin>>num[i].n;
		num[i].po=i;
	}
	for(int i=1;i<=q;++i){
		cin>>mode;
		if(mode==1){
			int id,change;
			cin>>id>>change;
			num[id].n=change;
		}
		if(mode==2){
			int re;
			cin>>re;
			sort(num+1,num+1+n,cmp);
			for(int i=1;i<=n;++i){
				if(num[i].po==re){
					cout<<i<<endl;
					break;
				}
			}
		}
	}
	return 0;
}
